package com.oa.xinxi.dao;

import com.oa.xinxi.entity.WorkZJ;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.mybatis.spring.annotation.MapperScan;
@MapperScan
public interface WorkZJMapper {
    @Delete({
        "delete from workzongjie",
        "where work_zj_id = #{workZjId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer workZjId);

    @Insert({
        "insert into workzongjie (work_zj_id, title, ",
        "auth_id, creator, ",
        "createtime, updator, ",
        "updatetime, work_zj_content)",
        "values (#{workZjId,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, ",
        "#{authId,jdbcType=INTEGER}, #{creator,jdbcType=VARCHAR}, ",
        "#{createtime,jdbcType=TIMESTAMP}, #{updator,jdbcType=VARCHAR}, ",
        "#{updatetime,jdbcType=TIMESTAMP}, #{workZjContent,jdbcType=LONGVARCHAR})"
    })
    int insert(WorkZJ record);

    @InsertProvider(type=WorkZJSqlProvider.class, method="insertSelective")
    int insertSelective(WorkZJ record);

    @Select({
        "select",
        "work_zj_id, title, auth_id, creator, createtime, updator, updatetime, work_zj_content",
        "from workzongjie",
        "where work_zj_id = #{workZjId,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="work_zj_id", property="workZjId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="auth_id", property="authId", jdbcType=JdbcType.INTEGER),
        @Result(column="creator", property="creator", jdbcType=JdbcType.VARCHAR),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="updator", property="updator", jdbcType=JdbcType.VARCHAR),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="work_zj_content", property="workZjContent", jdbcType=JdbcType.LONGVARCHAR)
    })
    WorkZJ selectByPrimaryKey(Integer workZjId);

    @UpdateProvider(type=WorkZJSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WorkZJ record);

    @Update({
        "update workzongjie",
        "set title = #{title,jdbcType=VARCHAR},",
          "auth_id = #{authId,jdbcType=INTEGER},",
          "creator = #{creator,jdbcType=VARCHAR},",
          "createtime = #{createtime,jdbcType=TIMESTAMP},",
          "updator = #{updator,jdbcType=VARCHAR},",
          "updatetime = #{updatetime,jdbcType=TIMESTAMP},",
          "work_zj_content = #{workZjContent,jdbcType=LONGVARCHAR}",
        "where work_zj_id = #{workZjId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(WorkZJ record);

    @Update({
        "update workzongjie",
        "set title = #{title,jdbcType=VARCHAR},",
          "auth_id = #{authId,jdbcType=INTEGER},",
          "creator = #{creator,jdbcType=VARCHAR},",
          "createtime = #{createtime,jdbcType=TIMESTAMP},",
          "updator = #{updator,jdbcType=VARCHAR},",
          "updatetime = #{updatetime,jdbcType=TIMESTAMP}",
        "where work_zj_id = #{workZjId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(WorkZJ record);
    @Select({
        "select",
        "work_zj_id, title, auth_id, creator, createtime, updator, updatetime, work_zj_content",
        "from workzongjie"
    })
    @Results({
        @Result(column="work_zj_id", property="workZjId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="auth_id", property="authId", jdbcType=JdbcType.INTEGER),
        @Result(column="creator", property="creator", jdbcType=JdbcType.VARCHAR),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="updator", property="updator", jdbcType=JdbcType.VARCHAR),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="work_zj_content", property="workZjContent", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<WorkZJ> findAll();
}